package buyer_user_info

import (
	"wwt-gin-api/app/model/api_model"
)

func CreateBuyerUserCurdFactory() *BuyerUserCurd {
	return &BuyerUserCurd{buyerUserModel: api_model.CreateBuyerUserInfoFactory("")}
}

type BuyerUserCurd struct {
	buyerUserModel *api_model.BuyerUserInfo
}

func (receiver *BuyerUserCurd) GetOne(whereMap map[string]interface{}) bool {
	if len(whereMap) == 0 {
		return false
	}
	model := &api_model.BuyerUserInfo{}
	for k, val := range whereMap {
		model.Where(k, val)
	}
	model.First(model)
	return true
}
